// 订单详情类
class OrderDetail {
    private int quantity;
    private Product product;

    public OrderDetail(int quantity, Product product) {
        this.quantity = quantity;
        this.product = product;
    }

    public double calculateSubTotal() {
        return product.getPriceForQuantity(quantity);
    }

    public double calculateWeight() {
        return product.getWeight() * quantity;
    }
}